package com.gupao.pattern.factory.simple;

public class SimpleFactory implements PhoneFactory {
    public AbstractPhone getPhone(String name) {
        if("iphone".equals(name)){
            return new Iphone();
        }else if("vivo".equals(name)){
            return new Vivo();
        }else{
            System.out.println("未能生产出此手机!");
            return null;
        }
    }
}
